/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package InternetHax;

import InternetHax.ConsumableApp;
import java.util.Vector;
import javax.microedition.lcdui.game.Sprite;

/**
 * Every game needs a hero, the Hero class is a specialized actor that is controlled by the player.
 * There should only ever be one Hero in the game at a time, to prevent confusion by the AI.
 * @author LoginError
 */
public class Hero extends Actor {

    private int actionPoints = 1;
    private Vector inventory;
    private App[] equippedApps = new App[9];
    private ConsumableApp bits;
    
    private short damageReduction = 0;
    private short damageReductionPercent = 0;
    private short attackBonus = 0;
    private short attackBonusPercent = 0;

    public Hero(Sprite thesprite) {
        super(thesprite);
        bits = new ConsumableApp(0);
        inventory = new Vector();
    }


    public Vector getInventory() {
        return inventory;
    }

    public void setInventory(Vector inventory) {
        this.inventory = inventory;
    }

    public App[] getEquippedApps() {
        return equippedApps;
    }

    public String toString()
    {
        String info = "The Hero\nName: "+ name +"\n"+ super.toString()+ "Equipped Apps\n";

        for (int i = 0; i < equippedApps.length; i++) {
            App app = equippedApps[i];

            info += (i+1) + ":" + (app == null? "Nothing" : app.toString()) + "\n" ;
        }
        info +="\n";
        if(inventory.size() == 0)
            info += "Inventory:Empty";

        else{
            info +="Inventory:\n";
            for (int i = 0; i < inventory.size(); i++) {
                App app = (App) inventory.elementAt(i);
                info += app.toString() + "\n";
            }
        }
        return info;
    }

    public void setEquippedApps(App[] equippedApps) {
        this.equippedApps = equippedApps;
    }
}